#ifndef BASE_H
#define BASE_H

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif


int  resize_any(unsigned char *pImage ,int srcwidth ,int srcheight ,unsigned char *presult ,int dstwidth , int dstheight );

typedef struct RECT
{
	int left;
	int right;
	int top;
	int bottom;
}*PRECT;

typedef struct SIZE
{
	int cx;
	int cy;
}SIZE;


#if 1

typedef int  int32 ;
typedef short  int16 ;
typedef unsigned short uint16 ;
typedef  char int8 ;
typedef unsigned int uint32 ;
typedef unsigned char uint8 ;

typedef struct _INT32X2
{
	int16 lo;
	int16 hi;
} int32x2;

typedef struct _INT32X2U
{
	uint16 lo;
	uint16 hi;
} int32x2u;

typedef struct _INT32X4
{
	int8 lo1;
	int8 lo2;
	int8 hi1;
	int8 hi2;
} int32x4;

typedef struct _INT32X4U
{
	uint8 lo1;
	uint8 lo2;
	uint8 hi1;
	uint8 hi2;
} int32x4u;

union reg32 
{
	int32    x1;
	int32x2  x2;
	int32x4  x4;

	uint32   x1u;
	int32x2u x2u;
	int32x4u x4u;

	float    xf;
};

#define MIN_INT8         ((int32)(0xFFFFFF80))
#define MAX_INT8         ((int32)(0x0000007F))

#define MIN_UINT8       ((uint32)(0x00000000))
#define MAX_UINT8       ((uint32)(0x000000FF))


#endif 

#endif 
